using MeiluluSqlite;
using MeiluluSqlite.DataMode;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyDataSource
{
    public class LocalData : IData
    {
        DB db;
        public LocalData()
        {
            db = new DB();
        }

        public bool AddUserInfo(User user)
        {
            return db.Insert(user);
        }

        public User GetUserInfo(string userid)
        {
            var use = db.Select<User>("username='" + userid + "'");
            if (use.Count>0)
            {
                return use[0];
            }
            else
            {
                return null;
            }
        }
    }
}
